#include <iostream>
#include <map>
#include <string>
//
// Created by lingzhitech on 25-9-29.
//
int main() {
    // count the number of times each word occurs in the input
    std::map< std::string, size_t> word_count; // empty map from string to size_t
    std::string word;
    while (std::cin >> word)
        ++word_count[word]; // fetch and increment the counter for word
    for (const auto &w : word_count) // for each element in the map
        // print the results
        std::cout << w.first << " occurs " << w.second
            << ((w.second > 1) ? " times" : " time") << endl;
}